home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / queues.exe / DESTROYQ.C < prev    next >
Text File  |  1992-01-13  |  2KB  |  69 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2.  *                                                                           *
  3.  *                                                                           *
  4.  Program : DESTROYQ.C
  5.  Date    : 05/20/91
  6.  Function: DESTROYQ destroys a queue created with CREATQ.
  7.  Genesis : Turbo C 2.0
  8.            Compiled in Turbo C environment with defaults under DOS 3.3.
  9.  
  10.  This software is provided as is and carries no warranty
  11.  whatsoever.  Novell disclaims and excludes any and all implied
  12.  warranties of merchantability, title and fitness for a particular
  13.  purpose.  Novell does not warrant that the software will satisfy
  14.  your requirements or that the software is without defect or error
  15.  or that operation of the software will be uninterrupted.  You are
  16.  using the software at your risk.  The software is not a product
  17.  of Novell, Inc. or any of subsidiaries.
  18.  *                                                                           *
  19.  *                                                                           *
  20.  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  21.  
  22. #include <stdio.h>
  23. #include <dos.h>
  24. #include <nit.h>
  25. #include <niterror.h>
  26. #include <nitq.h>
  27.  
  28. #define INT21          0x21
  29. #define OT_TEST_SERVER 0x8010
  30. #define OT_TEST_QUEUE  0x8020
  31.  
  32. char GetCurrentDrive (void);
  33. void main (void);
  34.  
  35. void main() {
  36.     int  cCode;
  37.     long queueID;
  38.     BYTE drive ;
  39.     BYTE dirHandle;
  40.  
  41.     drive = GetCurrentDrive() ;
  42.     dirHandle = GetDirectoryHandle (drive);
  43.     if (cCode = GetBinderyObjectID ("CHRIS_QUEUE",
  44.                                     OT_TEST_QUEUE,
  45.                                     &queueID)) {
  46.       printf ("\nError %d getting bindery object ID.", cCode);
  47.       exit (1);
  48.       }
  49.     if (cCode = DestroyQueue (queueID)) {
  50.       printf ("\nError %d destroying queue.", cCode);
  51.       exit (1);
  52.       }
  53.      else printf ("\nQueue destroyed.");
  54.     if (cCode = DeleteBinderyObject ("CHRIS_SERVER",
  55.                                      OT_TEST_SERVER))
  56.       printf ("\nError %d deleting bindery object.", cCode);
  57.     else printf ("\nBindery object deleted.");
  58. }
  59.  
  60. char GetCurrentDrive()
  61. {
  62.     union REGS reg ;
  63.     struct SREGS segs ;
  64.  
  65.     reg.h.ah = 0x19 ;
  66.     int86x(INT21,®,®,&segs) ;
  67.     return(reg.h.al) ;
  68. }
  69.